home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-07-15 | 2.4 KB | 89 lines | [TEXT/MPS ] |
- PROGRAM KeyMapTst;
-
- {Cameron Birse, Macintosh Technical Support}
- {$load KeyLoad}
- uses Memtypes,QuickDraw,OSIntf,ToolIntf,UWritelnWindow;
-
-
- VAR
- err,i,x,y : Integer;
- MyStr : str255;
- myKeyMap,oldKeyMap : KeyMap;
- quit,yes : boolean;
- MyRect : rect;
-
-
- {------------------------------------------------------------------------------------}
- {
- FUNCTION SysEnvirons(versionRequested: INTEGER; VAR theWorld: SysEnvRec): OSErr;
-
- INLINE $205f,$301f, $A090, $3e80;
-
- PROCEDURE ShutDwnStart;
- INLINE $3F3C,$0002,$A895;
-
- }
- {------------------------------------------------------------------------------------}
-
-
- BEGIN {main PROGRAM}
- InitGraf(@thePort); {initialize QuickDraw}
- FlushEvents(everyEvent, 0); {call OS Event Mgr to discard any previous events}
- InitWindows; {initialize Window Manager}
- InitCursor; {call QuickDraw to make cursor (pointer) an arrow}
-
- {PROCEDURE WWInit(numLines, numCharsPerLine: INTEGER);}
-
- WWInit(25,65); {initialize WritelnWindow with default window}
-
- {PROCEDURE WWNew(bounds: Rect; windowTitle: Str255; goAway: BOOLEAN; visible: BOOLEAN;
- outputFont, outputSize: INTEGER);}
-
- Myrect.top := ScreenBits.bounds.top+40;
- Myrect.left := ScreenBits.bounds.left+4;
- Myrect.bottom := ScreenBits.bounds.bottom-4;
- Myrect.right := ScreenBits.bounds.right-4;
-
- WWNew(MyRect, 'A Window, eh?', true, true, 1,9);
-
-
- quit := false;
- yes := false;
- writeln ('KeyMap :');
- for i := 0 to 127 do
- begin
- if myKeyMap[i] then write('1')
- else write('0');
- if i = 63 then writeln ('');
- oldKeyMap[i] := myKeyMap[i];
- if button then quit := true;
- end;
- writeln ('');
- repeat
- if button then quit := true;
- GetKeys (myKeyMap);
- for x := 0 to 127 do
- begin
- if myKeyMap[x] <> oldKeyMap[x] then
- begin
- yes := true;
- y := x;
- end;
- end;
- if yes then
- begin
- writeln ('Bit # ',y,' changed, KeyMap =');
- yes := false;
- for i := 0 to 127 do
- begin
- if myKeyMap[i] then write('1')
- else write('0');
- if i = 63 then writeln ('');
- oldKeyMap[i] := myKeyMap[i];
- if button then quit := true;
- end;
- writeln (' end');
- end;
- until quit;
-
- END.